const path = require('path');

module.exports = {
  output: {
    path: path.join(__dirname, `./dist`),
    publicPath: '/public/',
  },
  module: {
    rules: [
      {
        enforce: 'pre', // 在真正执行代码编译之前，先执行eslint，一旦报错，就不编译
        test: /\.(js|jsx)/,
        use: 'eslint-loader',
        exclude: [
          path.join(__dirname, './node_modules')
        ]
      },
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use: 'babel-loader',
      }
    ]
  }
}